$(document).ready(function () {
	$('#submitter').click(function () {
		$logout = $(this);
		$.ajax({
			url: $logout.attr('url'),
			format: 'json',
			beforeSend: function () {
				wait_block('document-container-background p', JAVASCRIPT_WAIT);
			},
			success: function (data) {
				if (data.logout == false) {
					$('#documentresponse').html(data.message);
			    }
			    else {
			    	$('#document-container-background p').html(data.message);
			    	$('#documentresponse').empty();
					setTimeout(function () {
						parent.window.location.href = './';
					}, 3000);
				}
			}
		});
		return false;
	});
});